<?php include './application/views/common/zhs_header.php';?>

<?php include './application/views/common/zhs_usercenter_acnt.php';?>
<div class="inv_box w">
<?php include './application/views/common/zhs_usercenter_left.php';?>
 
  <div class="membd_right">
  <h3 class="membdrg_tit">我的投资标的</h3>
  <div class="membox_bd">

  
  <?php 
  	if(empty($tender_list)){ ?>
  	    <div class="mmbo">
      	 <span>目前没有投资产品，您可以看看<a href="/borrow/zhs_blist.html" class="red">理财推荐</a></span>
   		 </div>
   <?php }else{?>
  	<table class="memzdbd_tab" style="margin-top:14px;">
      <thead>
        <tr>
          <th width="222" height="38">标 题</th>
	      <th width="87">年化利率</th>
          <th width="106">理财金额</th>
          <th width="98">理财周期</th>
          <th width="89">标的状态</th>
          <th width="169">投资时间</th>
          <th width="137">投标金额</th>
           
          <th width="101">预计利息</th>
          <th width="101">操作</th>
        </tr>
      </thead>
      <tbody>
        <?php
        	//$borrow_obj['ftype_name']  = $borrow_type; 
			foreach ($tender_list as $tender){
		?>
          <tr>
            <td height="44">
       	 		<a href="/borrow/zhs_obj/<?php echo $tender['borrow_id'];?>" class="cnxq_a<?php echo $tender['ftype'];?>"><?php echo CON_NAME;?></a><a href="/borrow/zhs_obj/<?php echo $tender['borrow_id'];?>">-<?php echo $borrow_type[$tender['ftype']].$tender['borrow_id'];?></a>
            </td>
            <td><?php echo $tender['apr'];?>%</td>
            <td>￥<?php echo $tender['borr_acc'];?></td>
            <td><?php if($tender['is_day'] == '1') echo "<span>".$tender['time_limit_day']."</span> 天"; else echo "<span>".$tender['time_limit']."</span> 月"; ?></td>
            <td>
            	<?php if ($tender['account_yes'] < $tender['borr_acc'] && $tender['fstatus']==1 ){
					echo "招标中";
				}elseif($tender['fstatus'] == 1 && $tender['borr_acc'] <= $tender['account_yes'] ){
					echo "待审中";
				}elseif($tender['fstatus'] == 3 && $tender['repayment_account'] > $tender['repayment_yesaccount']){
					echo "理财中";
				}elseif($tender['fstatus'] == 3 &&  $tender['repayment_account'] <= $tender['repayment_yesaccount']){
					echo "已结束";
				}
				?>
			</td>
			  <td><?php echo date("Y-m-d H:i",$tender['add_time']);?></td>
			 <td>￥<?php echo $tender['account'];?></td>
			 
			  <td>￥<?php $rew = $tender['wait_interest']; echo round($rew,2);?></td>
			  <td><a href="/site/zhs_zhsjr/29/<?php echo $tender['id'];?>.html">协议</a></td>
          </tr>
         <?php 
		}
		?> 
      </tbody>
    </table>
     <div class="invbd_page"><?php echo $this->pagination->create_links();?></div>
  <?php }?>
  
  </div>  
   <div class="jxq_tcb">
       <h3>收益计算器 <a title="关闭" class="close"></a></h3>
        <ul class="jxq_cont">
            <li><span>投资金额：</span><input type="text" id="account" onblur="Calculate()">元</li>
            <li><span>年化收益：</span><input type="text" id="apr" readonly></li>
            <li><span>计息时长：</span><input type="text" id="time_limit" readonly></li>
            <li><span>预计收益：</span><input type="text" id="money" value = "0.00" size="8" readonly>元</span></li>
            <li><a href="javascript:;" id="tzi"><img src="/static/zhsjr/images/in_14.gif"></a></li>
       </ul>
       
 </div>
  <h3 class="membdrg_tit mt">理财推荐</h3>
  <div class="membox_bd"><table class="memzdbd_tab" style="margin-top:14px;">
      <thead>
        <tr>
         <th width="17%">标 题</th>
        <th width="12%">年化利率</th>
        <th width="13%">理财金额(元)</th>
        <th width="12%">理财周期</th>
        <th width="15%"> 理财进度</th>
       	<th width="15%" ><span>操作&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <a href="/borrow/zhs_blist.html">更多> </a></th>
        
        </tr>
      </thead>
      <tbody>
        <?php 
		foreach ($borrow_list as $borrow){
		?>
          <tr>
             <td height="44">
       
       	 		<a href="/borrow/zhs_obj/<?php echo $borrow['id'];?>" class="cnxq_a<?php echo $borrow['ftype'];?>"><?php echo CON_NAME;?></a><a href="/borrow/zhs_obj/<?php echo $borrow['id'];?>">-<?php echo $borrow_type[$borrow['ftype']].$borrow['id'];?></a>

        	</td>
        	<td width="13%"><?php echo $borrow['apr'];?>%</td>
        	<td width="14%"><?php echo $borrow['account'];?></td>
        	<td width="13%"><?php if($borrow['is_day'] == '1') echo "<span>".$borrow['time_limit_day']."</span> 天"; else echo "<span>".$borrow['time_limit']."</span> 月"; ?></td>
        	<td width="16%">
        		<div class="pb-container"> 
                	<div class="pb-value" style="width:<?php echo round($borrow['account_yes']/$borrow['account']*100);?>%"></div>
                </div>
                <h4><?php echo round($borrow['account_yes']/$borrow['account']*100);?>%</h4>
             </td>
        	<td width="15%">
        		<a href="/borrow/zhs_obj/<?php echo $borrow['id'];?>" class="rztp_btn">投标</a>
        	</td>
          
          </tr>
         <?php }?> 
         
      </tbody>
    </table> 
    </div>  
  </div>
</div> 
<?php include './application/views/common/zhs_footer.php';?>

<?php include './application/views/common/zhs_right.php';?>

